package com.lanju.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.fasterxml.jackson.annotation.JsonIgnore;

@Entity
@Table(name = "lj_house")
public class House implements Serializable{

    /**
     * 
     */
    private static final long serialVersionUID = -1600219019264329257L;
    /**
     * 
     */
    
    private String houseId;
    private String houseName;
    private Integer houseSize;
    private String houseLayout;
    private String address;
    private Integer price;
    private String introduction;
    private String towards;
    private String years;
    private String floor;
    private String city;
    private String area;
    private String flag;
    private String type; 
    private String remark;
    private Date createTime;
    private String creator;
    private String grade;
    private String elevator;
    private String  checkIn;//入住时间
    private String community;//小区名称
    private String communityDesc;
    private String status;
    private String allFloor;
    private String green;
    private String transport;
    private String metro;
    private String specialNote;
    private Integer leaseLength;//租约时长
    private String depositMethod;//押金方式
    private String holdId;//管家id
    private Integer community_id;//小区id
    private User user;
    private String userId;
    private String entrustType;
    private Set<HouseEquipment> houseEquipmentSet=new HashSet<HouseEquipment>();
    
    @Id
    @Column(name="houseId",unique=true,nullable=false)
	public String getHouseId() {
		return houseId;
	}
	public void setHouseId(String houseId) {
		this.houseId = houseId;
	}
	@Column(name="houseName")
	public String getHouseName() {
		return houseName;
	}
	public void setHouseName(String houseName) {
		this.houseName = houseName;
	}
	@Column(name="houseSize")
	public Integer getHouseSize() {
		return houseSize;
	}
	public void setHouseSize(Integer houseSize) {
		this.houseSize = houseSize;
	}
	@Column(name="houseLayout")
	public String getHouseLayout() {
		return houseLayout;
	}
	public void setHouseLayout(String houseLayout) {
		this.houseLayout = houseLayout;
	}
	@Column(name="address")
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	@Column(name="price")
	public Integer getPrice() {
		return price;
	}
	public void setPrice(Integer price) {
		this.price = price;
	}
	
	@Column(name="towards")
	public String getTowards() {
		return towards;
	}
	@Column(name="introduction")
	public String getIntroduction() {
		return introduction;
	}
	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}
	public void setTowards(String towards) {
		this.towards = towards;
	}
	@Column(name="years")
	public String getYears() {
		return years;
	}
	public void setYears(String years) {
		this.years = years;
	}
	@Column(name="floor")
	public String getFloor() {
		return floor;
	}
	public void setFloor(String floor) {
		this.floor = floor;
	}
	@Column(name="city")
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	@Column(name="area")
	public String getArea() {
		return area;
	}
	public void setArea(String area) {
		this.area = area;
	}
	@Column(name="flag")
	public String getFlag() {
		return flag;
	}
	public void setFlag(String flag) {
		this.flag = flag;
	}
	@Column(name="type")
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	@Column(name="remark")
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	 @Temporal(TemporalType.TIMESTAMP)
	@Column(name="createTime")
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@Column(name="creator")
	public String getCreator() {
		return creator;
	}
	public void setCreator(String creator) {
		this.creator = creator;
	}
	@Column(name="grade")
	public String getGrade() {
		return grade;
	}
	public void setGrade(String grade) {
		this.grade = grade;
	}
	@Column(name="elevator")
	public String getElevator() {
		return elevator;
	}
	public void setElevator(String elevator) {
		this.elevator = elevator;
	}
	@Column(name="checkIn")
	public String getCheckIn() {
		return checkIn;
	}
	public void setCheckIn(String checkIn) {
		this.checkIn = checkIn;
	}
	@Column(name="community")
	public String getCommunity() {
		return community;
	}
	public void setCommunity(String community) {
		this.community = community;
	}
	@Column(name="communityDesc")
	public String getCommunityDesc() {
		return communityDesc;
	}
	public void setCommunityDesc(String communityDesc) {
		this.communityDesc = communityDesc;
	}
	@Column(name="status")
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	@Column(name="allFloor")
	public String getAllFloor() {
		return allFloor;
	}
	public void setAllFloor(String allFloor) {
		this.allFloor = allFloor;
	}
	@Column(name="green")
	public String getGreen() {
		return green;
	}
	public void setGreen(String green) {
		this.green = green;
	}
	@Column(name="transport")
	public String getTransport() {
		return transport;
	}
	public void setTransport(String transport) {
		this.transport = transport;
	}
	@Column(name="metro")
	public String getMetro() {
		return metro;
	}
	public void setMetro(String metro) {
		this.metro = metro;
	}
	@Column(name="specialNote")
	public String getSpecialNote() {
		return specialNote;
	}
	public void setSpecialNote(String specialNote) {
		this.specialNote = specialNote;
	}
	@Column(name="leaseLength")
	public Integer getLeaseLength() {
		return leaseLength;
	}
	public void setLeaseLength(Integer leaseLength) {
		this.leaseLength = leaseLength;
	}
	@Column(name="depositMethod")
	public String getDepositMethod() {
		return depositMethod;
	}
	public void setDepositMethod(String depositMethod) {
		this.depositMethod = depositMethod;
	}
	
	@Column(name="holdId")
	public String getHoldId() {
		return holdId;
	}
	public void setHoldId(String holdId) {
		this.holdId = holdId;
	}
	@Column(name="community_id")
	public Integer getCommunity_id() {
		return community_id;
	}
	public void setCommunity_id(Integer community_id) {
		this.community_id = community_id;
	}
	@JsonIgnore
	@OneToMany(cascade={javax.persistence.CascadeType.ALL}, fetch=FetchType.EAGER, mappedBy="house")
	public Set<HouseEquipment> getHouseEquipmentSet() {
		return houseEquipmentSet;
	}
	public void setHouseEquipmentSet(Set<HouseEquipment> houseEquipmentSet) {
		this.houseEquipmentSet = houseEquipmentSet;
	}

//	@OneToMany(cascade={javax.persistence.CascadeType.ALL}, fetch=FetchType.EAGER, mappedBy="house")
//	public Set<HouseImg> getImgSet() {
//		return imgSet;
//	}
//	public void setImgSet(Set<HouseImg> imgSet) {
//		this.imgSet = imgSet;
//	}
	 @JsonIgnore
	 @ManyToOne(fetch=FetchType.LAZY)
	 @JoinColumn(name="uid", nullable=false )
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@Column(name="userId")
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	@Column(name="entrustType")
	public String getEntrustType() {
		return entrustType;
	}
	public void setEntrustType(String entrustType) {
		this.entrustType = entrustType;
	}
	
	
}
